# Contributor: Davis E. King <davis@dlib.net>
# Maintainer: Adriaan Groenenboom <agboom@pm.me>
pkgname=dlib
pkgver=19.23
pkgrel=0
pkgdesc="A toolkit for making real world machine learning and data analysis applications in C++"
url="http://dlib.net"
arch="all"
license="BSL-1.0"
makedepends="cmake openblas-dev libx11-dev libjpeg-turbo-dev libpng-dev"
source="dlib-$pkgver.tar.bz2::https://downloads.sourceforge.net/project/dclib/dlib/v$pkgver/dlib-$pkgver.tar.bz2"

build() {
	cd "$srcdir"
	mkdir -p build && cd build
	cmake \
	  -DCMAKE_INSTALL_PREFIX:PATH=/usr \
	  -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib \
	  -DBUILD_SHARED_LIBS:BOOL=ON \
	  -DCMAKE_BUILD_TYPE=None \
	  "../$pkgname-$pkgver"
	make
}

package() {
	cd "$srcdir/build"
	make DESTDIR=$pkgdir install
	install -Dm644 "../$pkgname-$pkgver/dlib/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
sha512sums="
97f1f5372ec1d69b8e7132175b01db3c3ab17ecc15430ae47add08286e0190198e130cdbd4f151c9017da5e79bba7694b8c9be62559a3bc485d288444286e627  dlib-19.23.tar.bz2
"
